﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ForfiterStockInfo.Entities
{
    public class Stock
    {
        public Stock() { }

        public Stock(long id, string name, string fullName)
        {
            Id = id;
            Name = name;
            FullName = fullName;
        }

        public long Id { get; set; }

        public string Name { get; set; }

        public string FullName { get; set; }

        public class StockNamesEqualityComparer : EqualityComparer<Stock>
        {
            public override bool Equals(Stock x, Stock y)
            {
                return x.Name == y.Name;
            }

            public override int GetHashCode(Stock obj)
            {
                return obj.Name.GetHashCode();
            }
        }
    }
}
